<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>祖龙娱乐  - BI系统</title>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../../js/highcharts.js"></script>
	<script type="text/javascript" src="../../js/drawChart.js"></script>
</h:head>

<h:body>
	<ui:param name="bean" value="#{overviewReportAction}" />
	
	<span class="pagetitle">运营报表 —— 概况</span>
	<p:separator />
	
	<!-- 右侧页面顶部查询部分 -->
	<h:form id="fsearch">
		<h:outputLabel id="radioHide" value="#{bean.dateRadio}" style="visibility: hidden"/>
	
	    <p:outputPanel id="customPanel" style="margin-bottom:10px">
	        <p:selectOneRadio id="customRadio" value="#{bean.dateRadio}" layout="custom">
	            <f:selectItem itemLabel="7" itemValue="7" />
	            <f:selectItem itemLabel="15" itemValue="15" />
	            <f:selectItem itemLabel="30" itemValue="30" />
	            <f:selectItem itemLabel="0" itemValue="0" />
	            <p:ajax update="radioHide customPanel :#{p:component('dform')}" listener="#{bean.radioChange}"/>
	        </p:selectOneRadio>
	 
	        <h:panelGrid id="opt" columns="14" cellpadding="5">
	            <p:radioButton id="opt1" for="customRadio" itemIndex="0" /> 
	            <h:outputLabel for="opt1" value="近7天" />
	            <h:outputLabel />
	 
	            <p:radioButton id="opt2" for="customRadio" itemIndex="1" />
	            <h:outputLabel for="opt2" value="近15天" />
	            <h:outputLabel />
	 
	            <p:radioButton id="opt3" for="customRadio" itemIndex="2" />
	            <h:outputLabel for="opt3" value="近30天" />
	            <h:outputLabel />
	             
	            <p:radioButton id="opt4" for="customRadio" itemIndex="3" />
	            <h:outputLabel for="opt4" value="自定义 开始时间" />
           	 	<p:calendar value="#{bean.dateStart}" mode="popup" pattern="yyyy-MM-dd">
           	 		<p:ajax event="dateSelect" listener="#{bean.spinnerChange}" update=":#{p:component('dform')}" onstart="return spinnered()" />
           	 	</p:calendar>
				<h:outputLabel for="opt4" value="结束时间" />
				<p:calendar value="#{bean.dateEnd}" mode="popup" pattern="yyyy-MM-dd">
					<p:ajax event="dateSelect" listener="#{bean.spinnerChange}" update=":#{p:component('dform')}" onstart="return spinnered()" />
				</p:calendar>
	        </h:panelGrid>
	    </p:outputPanel>
	</h:form>
	<br />
	
	<!-- 数据展示部分，包含表格和图表 -->
	<h:form id="dform">
		<h:panelGrid columns="1" style="width:100%">
             <div id="basewidth" style="width:92%;height:0; border:0;" />
        </h:panelGrid>
		<div class="data" id="data">

            <p:panel id="pane00" header="昨日数据" style="margin-bottom:10px;">
                <p:dataTable id="dlist00" var="l" value="#{bean.yesterdayDatas}" resizableColumns="true"  style="text-align:center;">
                    <p:column headerText="指标" styleClass="column" style="width:100px">
                        <h:outputLabel value="#{l.title}" />
                    </p:column>
                    <p:column headerText="激活设备" styleClass="column" style="width:100px">
                        <h:outputLabel value="#{l.activeDeviceRadio}" />
                    </p:column>
                    <p:column headerText="新增设备" styleClass="column" style="width:100px">
                        <h:outputLabel value="#{l.newDeviceRadio}" />
                    </p:column>
                    <p:column headerText="激活-新增转化率" styleClass="column" style="width:100px">
                        <h:outputLabel value="#{l.newOnActiveDevcieRadioRadio}" />
                    </p:column>
                    <p:column headerText="新增帐号" styleClass="column" style="width:100px">
                        <h:outputLabel value="#{l.newUserRadio}" />
                    </p:column>
                    <p:column headerText="活跃帐号" styleClass="column" style="width:100px">
                        <h:outputLabel value="#{l.activeUserRadio}" />
                    </p:column>
                    <p:column headerText="付费金额" styleClass="column" style="width:100px">
                        <h:outputLabel value="#{l.payRadio}" />
                    </p:column>
                    <p:column headerText="付费帐号" styleClass="column" style="width:100px">
                        <h:outputLabel value="#{l.payUserRadio}" />
                    </p:column>
                    <p:column headerText="活跃付费率" styleClass="column" style="width:100px">
                        <h:outputLabel value="#{l.payOnActiveUserRadioRadio}" />
                    </p:column>
                    <p:column headerText="付费ARPU" styleClass="column" style="width:100px">
                        <h:outputLabel value="#{l.payArpuRadio}" />
                    </p:column>
                    <p:column headerText="活跃ARPU" styleClass="column" style="width:100px">
                        <h:outputLabel value="#{l.activeArpuRadio}" />
                    </p:column>
                </p:dataTable>
            </p:panel>


			<p:panel id="panel0" header="总体数据" style="margin-bottom:10px;">
				<p:dataGrid var="d" value="#{bean.datas}" columns="6">
			        <p:panel header="#{d.title}" style="text-align:center">
                    <h:panelGrid columns="1" style="width:100%">
                        <h:outputText value="#{d.value}" />
                    </h:panelGrid>
			        </p:panel>
			    </p:dataGrid>
		    </p:panel>
		
			<p:panel id="panel1" header="在线趋势" style="margin-bottom:10px;">
				<p:dataGrid id="ccc1" var="c" value="#{bean.chartUIdata1}" columns="1" layout="grid">
			        <p:panel style="text-align:center">
			            <h:panelGrid columns="1" style="width:100%">
			                <div id="highchartChart1" style="width:100%;height:300px; border:0;">
								<script type="text/javascript">
									generateChart('#{c.jsonStr}', '#{c.jsonType}', '1');
								</script>  
							</div>
			            </h:panelGrid>
			        </p:panel>
			    </p:dataGrid>
			</p:panel>
			
			<p:panel id="panel2" header="活跃情况" style="margin-bottom:10px;">
				<p:dataGrid id="ccc3" var="c" value="#{bean.chartUIdata3}" columns="1" layout="grid">
			        <p:panel style="text-align:center">
			            <h:panelGrid columns="1" style="width:100%">
			                <div id="highchartChart3" style="width:100%;height:300px; border:0;">
								<script type="text/javascript">
									generateChart('#{c.jsonStr}', 'columnadd', '3');
								</script>  
							</div>
			            </h:panelGrid>
			        </p:panel>
			    </p:dataGrid>
			</p:panel>
			
			<p:panel id="panel3" header="留存情况" style="margin-bottom:10px;">
				<p:dataGrid id="ccc2" var="c" value="#{bean.chartUIdata2}" columns="1" layout="grid">
			        <p:panel style="text-align:center">
			            <h:panelGrid columns="1" style="width:100%">
			                <div id="highchartChart2" style="width:100%;height:300px; border:0;">
								<script type="text/javascript">
									generateChart('#{c.jsonStr}', '#{c.jsonType}', '2');
								</script>  
							</div>
			            </h:panelGrid>
			        </p:panel>
			    </p:dataGrid>
			</p:panel>
			
			<p:panel id="panel5" header="付费情况" style="margin-bottom:10px;">
				<p:tabView>
			    	<p:ajax event="tabChange" listener="#{bean.onTabChange}" update="pay1 pay2 pay3 pay4"/>
				    <p:tab title="付费额" id="pay">
				   		<p:dataGrid id="pay1" var="c" value="#{bean.chartUIdata5}" columns="1" layout="grid">
					        <p:panel style="text-align:center">
					            <h:panelGrid columns="1" style="width:100%">
					                <div id="highchartChart5" style="width:100%;height:300px; border:0;">
										<script type="text/javascript">
											generateChart('#{c.jsonStr}', '#{c.jsonType}', '5', 'basewidth');
										</script>  
									</div>
					            </h:panelGrid>
					        </p:panel>
					    </p:dataGrid>
				    </p:tab>
				    <p:tab title="付费人数" id="payUser">
				   		<p:dataGrid id="pay4" var="c" value="#{bean.chartUIdata5}" columns="1" layout="grid">
					        <p:panel style="text-align:center">
					            <h:panelGrid columns="1" style="width:100%">
					                <div id="highchartChart8" style="width:100%;height:300px; border:0;">
										<script type="text/javascript">
											generateChart('#{c.jsonStr}', '#{c.jsonType}', '8', 'basewidth');
										</script>  
									</div>
					            </h:panelGrid>
					        </p:panel>
					    </p:dataGrid>
				    </p:tab>
				    <p:tab title="付费率&#38;新增当日付费率" id="payRadio">
				    	<p:dataGrid id="pay2" var="c" value="#{bean.chartUIdata5}" columns="1" layout="grid">
					        <p:panel style="text-align:center">
					            <h:panelGrid columns="1" style="width:100%">
					                <div id="highchartChart6" style="width:100%;height:300px; border:0;">
										<script type="text/javascript">
											generateChart('#{c.jsonStr}', '#{c.jsonType}', '6', 'basewidth');
										</script>  
									</div>
					            </h:panelGrid>
					        </p:panel>
					    </p:dataGrid>
				    </p:tab>
				    <p:tab title="付费ARPU&#38;活跃ARPU" id="payArpu">
				    	<p:dataGrid id="pay3" var="c" value="#{bean.chartUIdata5}" columns="1" layout="grid">
					        <p:panel style="text-align:center">
					            <h:panelGrid columns="1" style="width:100%">
					                <div id="highchartChart7" style="width:100%;height:300px; border:0;">
										<script type="text/javascript">
											generateChart('#{c.jsonStr}', '#{c.jsonType}', '7', 'basewidth');
										</script>  
									</div>
					            </h:panelGrid>
					        </p:panel>
					    </p:dataGrid>
				    </p:tab>
				</p:tabView>
			</p:panel>
			
			<p:panel id="panel4" header="游戏时长（m）" style="margin-bottom:10px;">
				<p:dataGrid id="ccc4" var="c" value="#{bean.chartUIdata4}" columns="1" layout="grid">
			        <p:panel style="text-align:center">
			            <h:panelGrid columns="1" style="width:100%">
			                <div id="highchartChart4" style="width:100%;height:300px; border:0;">
								<script type="text/javascript">
									generateChart('#{c.jsonStr}', '#{c.jsonType}', '4');
								</script>  
							</div>
			            </h:panelGrid>
			        </p:panel>
			    </p:dataGrid>
			</p:panel>
		</div>
	</h:form>

	<!-- 页脚 -->
	<div class="footer"></div>
</h:body>
</html>